#ifndef __JSMPI_CMATRIX_H__
#define __JSMPI_CMATRIX_H__

#define TYPE_MATRIX_INTEGER 43
#define TYPE_MATRIX_DOUBLE 48

typedef struct cmatrix_gen_s
{
    int rows;
    int cols;
    void *data;
    bool is_slice;
} cmatrix_gen;

typedef struct cmatrix_int_s
{
    int rows;
    int cols;
    int *data;
    bool is_slice;
} cmatrix_int;

typedef struct cmatrix_double_s
{
    int rows;
    int cols;
    double *data;
    bool is_slice;
} cmatrix_double;

typedef struct cmatrix_int_row_s
{
    int size;
    int *data;
} cmatrix_int_row;

typedef struct cmatrix_double_row_s
{
    int size;
    double *data;
} cmatrix_double_row;

#define jsDoubleMatrix(val) ((cmatrix_double *)Handle<External>::Cast( val->ToObject()->Get( String::New("__data__") ) )->Value())

#endif
